package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author 陈浩
 * @date 2022/4/24
 */
@Data
public class DeptTreeVO implements Serializable {

    @ApiModelProperty(value = "部门编号", required = true, example = "1024")
    private Long id;

    @ApiModelProperty(value = "部门名称", required = true, example = "芋道")
    private String name;

    @ApiModelProperty(value = "父部门 ID", required = true, example = "1024")
    private Long parentId;

    /**
     * 类型 0 组织 1 用户
     */
    private Integer type;

    private List<DeptTreeVO> children;

    public static DeptTreeVO of(Long id, String name, Long parentId, Integer type) {
        DeptTreeVO deptTreeVO = new DeptTreeVO();
        deptTreeVO.setId(id);
        deptTreeVO.setName(name);
        deptTreeVO.setParentId(parentId);
        deptTreeVO.setType(type);
        return deptTreeVO;
    }

}
